////////////////////////////////////////////////////////////////////////////////
// Filename: gameobject.cpp
////////////////////////////////////////////////////////////////////////////////
#include "gameobject.hpp"

GameObject::GameObject(LPCSTR applicationName) {
	m_vsync = true;
	m_fullscreen = false;
	m_window = NULL;
	m_applicationName = applicationName;
}

GameObject::~GameObject() {

}

bool GameObject::Initialize() {
	bool result;

	m_window = new Window(m_applicationName);
	if (!m_window) {
		return false;
	}

	result = m_window->Initialize();
	if (!result) {
		return false;
	}

	return true;
}

void GameObject::Shutdown() {
	if (m_window) {
		m_window->Shutdown();
		delete m_window;
		m_window = NULL;
	}
}

int GameObject::GetWidth() {
	return m_window->GetWidth();
}

int GameObject::GetHeight() {
	return m_window->GetHeight();
}

HWND GameObject::GetHandle() {
	return m_window->GetHandle();
}

MarkIV::System::Input* GameObject::GetInput() {
	return m_window->GetInput();
}

bool GameObject::VSyncEnabled() {
	return m_vsync;
}

bool GameObject::FullscreenEnabled() {
	return m_fullscreen;
}

void GameObject::SetResolution(int width, int height) {
	m_window->SetResolution(width, height);
}



